home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Tele / U-V / USR Dual.cpt / USR Dual
Text File  |  1992-06-01  |  3KB  |  199 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11. ! "US Robotics Courier HST Dual"
  12. !
  13. ! ^1 is dial string
  14. !
  15. !---------------------------------------------------------------
  16. ! Main entry point for script
  17. !
  18. @ORIGINATE
  19. @ANSWER
  20. !
  21. ! Configure the serial port for 9600, no parity, 8 data, 1 stop
  22. !
  23. serreset 9600, 0, 8, 1
  24. !
  25. ! Init the modem
  26. ! Factory, DTR normal, no answer, echo off, hardware CTS, no ARQ, 
  27. ! extended results
  28. !
  29. matchclr
  30. matchstr 1 1 "OK\13\10"
  31. write "AT&F&D2S0=0E0&H1&M0X4B0&K3\13"
  32. matchread 30
  33. jump 59
  34. !
  35. ! The modem is ready so enable answering, or originate a call
  36. !
  37. @LABEL 1
  38. pause 5
  39. ifANSWER 5
  40. note "Dialing ^1" 3
  41. write "ATDT^1\13"
  42. jump 20
  43. !
  44. !---------------------------------------------------------------
  45. ! @ANSWER
  46. ! Set up the modem to answer
  47. !
  48. @LABEL 5
  49. write "ATS0=1\13"
  50. matchstr 1 20 "OK\13\10"
  51. matchread 30
  52. jump 59
  53. !
  54. !---------------------------------------------------------------
  55. ! Connection result strings
  56. !
  57. @LABEL 10
  58. userhook 1
  59. note "Answering phone…" 2
  60. jump 20
  61. !
  62. @LABEL 11
  63. note "Communicating at 1200 bps." 2
  64. serreset 1200, 0, 8, 1
  65. jump 19
  66. !
  67. @LABEL 12
  68. note "Communicating at 2400 bps." 2
  69. serreset 2400, 0, 8, 1
  70. jump 19
  71. !
  72. @LABEL 13
  73. note "Communicating at 4800 bps." 2
  74. serreset 4800, 0, 8, 1
  75. jump 19
  76. !
  77. @LABEL 14
  78. note "Communicating at 7200 bps." 2
  79. serreset 9600, 0, 8, 1
  80. CommunicatingAt 7200
  81. jump 19
  82. !
  83. @LABEL 15
  84. note "Communicating at 9600 bps." 2
  85. serreset 9600, 0, 8, 1
  86. jump 19
  87. !
  88. @LABEL 16
  89. note "Communicating at 12000 bps." 2
  90. serreset 19200, 0, 8, 1
  91. CommunicatingAt 12000
  92. jump 19
  93. !
  94. @LABEL 17
  95. note "Communicating at 14400 bps." 2
  96. serreset 19200, 0, 8, 1
  97. CommunicatingAt 14400
  98. jump 19
  99. !
  100. !---------------------------------------------------------------
  101. ! Return control to the calling program
  102. !
  103. @LABEL 18
  104. HSReset 0 1 0 0 0 0 
  105. ifANSWER 19
  106. pause 30
  107. @LABEL 19
  108. exit 0
  109. !
  110. !---------------------------------------------------------------
  111. ! Answer and Dial result strings
  112. !
  113. @LABEL 20
  114. matchstr 1  10 "RING\13\10"
  115. matchstr 2  11 "CONNECT 1200\13\10"
  116. matchstr 3  12 "CONNECT 2400\13\10"
  117. matchstr 4  13 "CONNECT 4800\13\10"
  118. matchstr 5  14 "CONNECT 7200\13\10"
  119. matchstr 6  15 "CONNECT 9600\13\10"
  120. matchstr 7  16 "CONNECT 12000\13\10"
  121. matchstr 8  17 "CONNECT 14400\13\10"
  122. matchstr 9  50 "NO CARRIER\13\10"
  123. matchstr 10 50 "ERROR\13\10"
  124. matchstr 11 52 "NO DIAL TONE\13\10"
  125. matchstr 12 53 "BUSY\13\10"
  126. matchstr 13 54 "NO ANSWER\13\10"
  127. matchread 700
  128. jump 20
  129. !
  130. !---------------------------------------------------------------
  131. ! 50: error messages
  132. !
  133. @LABEL 50
  134. exit -6021
  135. !
  136. @LABEL 52
  137. exit -6020
  138. !
  139. @LABEL 53
  140. exit -6022
  141. !
  142. @LABEL 54
  143. exit -6023
  144. !
  145. @LABEL 59
  146. exit -6019
  147. !
  148. !---------------------------------------------------------------
  149. ! Hang up the modem
  150. !
  151. @HANGUP
  152. settries 0
  153. HSReset 0 0 0 0 0 0 
  154. !
  155. @LABEL 61
  156. !
  157. ! Ask the modem to hang up
  158. !
  159. write "ATH\13"
  160. matchclr
  161. matchstr 1 62 "NO CARRIER\13\10"
  162. matchstr 2 62 "OK\13\10"
  163. matchstr 3 62 "ERROR\13\10"
  164. matchread 30
  165. !
  166. ! The modem did not hang up. Try to get its attention.
  167. !
  168. inctries
  169. iftries 3 62
  170. write "+++"
  171. matchclr
  172. matchstr 1 61 "OK\13\10"
  173. matchread 8
  174. !
  175. ! Escape sequence did not work, try DTR.
  176. !
  177. DTRClear
  178. pause 15
  179. DTRSet
  180. pause 15
  181. jump 61
  182. !
  183. @LABEL 62
  184. ! recall the factory settings
  185. pause 15
  186. write "AT&F\13"
  187. matchclr
  188. matchstr 1 63 "OK\13\10"
  189. matchread 30
  190. !
  191. @LABEL 63
  192. pause 5
  193. matchstr 1 64 "OK\13\10"
  194. write "ATS0=0\13"
  195. matchread 20
  196. !
  197. @LABEL 64
  198. exit 0
  199.